/*
 * Copyright (C) 2011 Nicola Bonzanni
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nl.vu.few.ibivu.jlemon.algorithms;

import nl.vu.few.ibivu.jlemon.concepts.Arc;
import nl.vu.few.ibivu.jlemon.concepts.Node;

public interface GraphVisitor <N extends Node & Comparable<N>, A extends Arc & Comparable<A>> {
	    /// \brief Called for the source node of the DFS.
	    ///
	    /// This function is called for the source node of the DFS.
	    void start(N node);
	    /// \brief Called when the source node is leaved.
	    ///
	    /// This function is called when the source node is leaved.
	    void stop(N node);
	    /// \brief Called when a node is reached first time.
	    ///
	    /// This function is called when a node is reached first time.
	    void reach(N node);
	    /// \brief Called when an arc reaches a new node.
	    ///
	    /// This function is called when the DFS finds an arc whose target node
	    /// is not reached yet.
	    void discover(A arc);
	    /// \brief Called when an arc is examined but its target node is
	    /// already discovered.
	    ///
	    /// This function is called when an arc is examined but its target node is
	    /// already discovered.
	    void examine(A arc);
	    /// \brief Called when the DFS steps back from a node.
	    ///
	    /// This function is called when the DFS steps back from a node.
	    void leave(N node);
	    /// \brief Called when the DFS steps back on an arc.
	    ///
	    /// This function is called when the DFS steps back on an arc.
	    void backtrack(A arc);
}
